home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PD Collection CD 1
/
PD Collection CD 1.iso
/
utils3
/
rma
/
!RMAManagr
/
!Help
next >
Wrap
Text File
|
1993-09-21
|
11KB
|
305 lines
=============================================================================
RMA-MANAGER © 1993 Topix
=============================================================================
-=-=-=-=-= INTRODUCTION =-=-=-=-=-
RMA-Manager is an environmental friendly product, in that it brings back to
life, that what is in suspended animation.
In more clear English: RMA-Manager tries to return memory-pages which are in
free RMA-space.
Still don't get it (I would neither)? Well let me explain it clearly with
some 'technical' terms, after a quick history lesson:
-=-=-=-=-= HISTORY OF TOPIX =-=-=-=-=-
Before you read any of the following I should warn you that not a word of it
is true.
Topix is in fact an organisation originally set up in 1955 as a highly
secret group to organise underground resistance against a communist
government should this ever come to power in Western Europe. With the
chances of this ever happening sharply declining over the last couple of
years it developed a severe crisis of identity, necessitating intensive
psychiatric treatment for the leading figures within Topix. As a means of
providing them with a new reason to live, their therapists decided to
brainwash them into releasing Public Domain software for an obscure computer
known only by insiders as "Archimedes". Although the brainwash was
incomplete (still the members of Topix are only known by their code names
'Pervect', 'Logic' and 'Cardinal Biggles'), they proved to be able to reach
an extremely high level of excellence at the task that was set for them.
So, if you're in some sort of computer trouble, and no-one else can help,
maybe you can hire..... TOPIX!
-=-=-=-=-= 'TECHNICAL' EXPLAINATION =-=-=-=-=-
The RMA (Relocatable Module Area), also called 'Module area' (in the Tasks-
window) is a linear,continuous block of memory in which modules are loaded
and work space can be claimed from.
When modules are killed or work space is released, free areas arise.
The next time a module is loaded or work space is claimed, the OS will try to
fill up those free areas. If none of the free areas is large enough to be
able to perform the desired action on, your OS will try to enlarge the RMA.
In itself this method is quite nice. BUT: As the RMA is a continuous block
of memory, the only time memory is released from it is when you shrink the
RMA. And to be able to do that the end of the RMA must be a free area.
Suppose your RMA looks like this:
start end
--------------------------------------------------
in use | in use | free | in use | free | in use |
8K | 2K | 57K | 34K | 230K | 1K |
--------------------------------------------------
The only reason you can't get that 230K back is due to the 1K 'in use' at the
end of RMA. Getting back the free 57K is also out of the question.
Situations like this very often occur: Suppose we have an empty RMA.
Start up a (desktop) program which loads large modules and/or claims a lot of
work space.:. Now load another program that uses RMA (more than the largest
free block, in order to get the claimed space behind the RMA space used by
the first program) or do something else that will cause the computer to claim
RMA space.
Now kill the first program. It will kill its modules and workspace, causing
a free area. This free area however is not at the end of RMA. It is followed
by the 'in use' space of the second program.
Suppose the size of the free area that has been caused by killing the first
program is 280K. When you now start up another program, which claims 300K of
workspace, the RMA has to be enlarged by 300K because the largest free area
is 280K.
You have 280K of memory in the RMA which is now not used and could be used
to load other programs or enlarge RAM-discs, whatever you can do with memory
in the Next/Free area.
What does RMA-Manager have to do with all of this?
RMA-Manager would have given you that 280K of memory back!!!!
Well, not exactly 280K:
RAM pages: 1MBytes machines have 128 pages of 8KBytes
2 " " " 128 " of 16 "
4 " " " 128 " of 32 "
8 " " " 256 " of 32 "
RMA starts at the start of a page.
You could see the RMA as a chain of pages.
Example: take a 2MBytes machine, 128 pages of 16KBytes.
Lets say your RMA has a size of 160K. It then can be seen as a chain of 10
pages. 'In use' and 'free' areas can start at any position within a page and
continue over multiple pages. They can also end anywhere in a page. Therefore
a page can contain more than one module or workspace or free areas.
When an area is freed, RMA-Manager will give back pages which consist of free
areas only.
Suppose we free an area which starts at the start of page and has a size of
140K. At least 8 pages will be released now. 8*16=128, leaving (140-128)=
12K. The page containing the last 12K will only be released if it doesn't
contain any (part of) modules or workspace.
It all comes down to this:
RMA-Manager returns all memory pages from RMA just being there and doing
nothing and containing nothing.
I must say that I was surprised when I bought RISCOS-3 and discovered that
this problem, which already existed in Arthur, still hadn't been solved by
Acorn.
Ah well, it will from now on never bother you again.
-=-=-=-=-= SOME OTHER THINGS =-=-=-=-=-
Some other things:
When running the RMA-Manager the 'Module area' bar (in the Tasks-window) will
indicate how much memory really is in RMA. The 'Free in module area' and
'Largest block' will always indicate an area of 0K. Don't think that indeed
there is 0K free in RMA. There almost is always free memory in RMA, but the
free bars will from now on always just indicate 0K.
So 'Module area' can be 304K and the 'Free in module area'-bar indicates
0K. This means that the RMA is at least 304K large (it could as well be
640K) and contains only 304K of real memory.
-=-=-=-=-= RISCOS-2/3 AND EXTRA SWI =-=-=-=-=-
RISCOS-2/3:
RMA-Manager should run on both RISCOS-2 and 3 machines.
Notice: RMA-Manager uses "OS_FindMemMapEntries", a SWI which didn't exist
in RISCOS-2. I have enclosed this SWI in the RMA-Manager. So when running
RMA-Manager you can also use "OS_FindMemMapEntries" on RISCOS-2 machines.
Here follows the description of "OS_FindMemMapEntries" (SWI &60):
entry: R0=pointer to buffer
buffer: a list of 3 words long info blocks
info block: word 0 memory page number
word 1 logical address it is mapped to
word 2 protection level
0 readable and writeable by everybody
1 read-only in user mode
2 inaccessible in user mode
the list ends when word 0 of an info block is -1
exit: per info block the memory page is searched for which is indeed mapped
to the logical address. The protection level will also be outputted.
example: suppose you want to know the page numbers of the pages which are
mapped to addresses &8000 and &C000, you first set up this list
list: word 0 page suggestion for address &8000
word 1 &8000
word 2 x
word 3 page suggestion for address &C000
word 4 &C000
word 5 x
word 6 -1
SYS"OS_FindMemMapEntries",list
list: word 0 page mapped to address &8000 or -1 if not found
word 1 &8000
word 2 protection level of page mapped to address &8000 or 3
if page not found
word 3 page mapped to address &C000 or -1 if not found
word 4 &C000
word 5 protection level of page mapped to address &C000 or 3
if page not found
word 6 -1
If you have an idea of which page it might be that is mapped to a
certain address, you can enter that at the page suggestion. This
can decrease the time it takes to find the page number.
If you don't have a clue at all you should enter 0 for the page
suggestion.
If there is no page at all mapped to a certain address, the page
number on output for that address will be set to -1.
NOTE: On RISCOS-2 you won't be able to type (or use )
'SYS "OS_FindMemMapEntries"' in BASIC or 'SWI "OS_FindMemMapEntries"'
in assembler. Use SYS &60 or SWI &60 instead !
-=-=-=-=-= HMMMM =-=-=-=-
Hmmm, this !Help text is already more than 3 times as large as the module it
is about.....hmmmm.....
Well nothing to do about that.... we'll just go on and on and on and on...
What is there more to say about RMA-Manager ???? Ah yeah,
-=-=-=-=-= VERY IMPORTANT =-=-=-=-=-
When initialising, RMA-Manager will not release free RMA memory, which was
created before RMA-Manager was loaded. SO:
!! PUT RMA-MANAGER IN YOUR BOOT-SEQUENCE AND LOAD IT AS EARLY AS POSSIBLE !!
(AFTER ANY VIRUS-KILLER MODULES OFCOURSE)
-=-=-=-=-= GOOD BYE =-=-=-=-=-
I hope that this program may be of some use for you, and hope to type to you
again soon in the next Topix-release.
-=-=-=-=-= P.S. =-=-=-=-=-
P.S.: you are free to copy just the module to put it in your !Boot.Modules
directory, but when copying for spreading, please copy the entire !RMAManagr
directory (!Help, !Run, !Sprites, RMAManager).
-=-=-=-=-= ADDRESSES & TELEPHONE NUMBERS =-=-=-=-=-
To contact Topix write to:
Eli-Jean Leyssens (Pervect)
Calslaan 13-201
7522 MH Enschede
The Netherlands
or
Ferdinand Veldmans (Logic)
Calslaan 13-210 (No, this is no typing error)
7522 MH Enschede
The Netherlands
or
Mark Koek (Cardinal Biggles)
Flanorpad 2d
2333 AN Leiden
The Netherlands
Or if you think you can withstand my (Pervect) hypnotic voice, call me at:
int-code + 31 - 53 - 895020 (outside the Netherlands)
053 - 895020 (binnen Nederland)
895020 (binnen Enschede)
5020 (op de Campus)
0-9999-895020 (from the same phone)
20 (xguppoekopperaf)
If this text went by too fast,
I think you'll agree it's about
bloody time you upgraded to
RISC-OS 3.